From Cppreference
|
|
| template< class Mutex >
class lock_guard;
|
| (since C++11)
|
|
|
|
The class lock_guard implements a strictly scope-based mutex ownership wrapper. The class is non-copyable.
The supplied Mutex type shall implement the Lockable concept.
[edit] Member types
|
|
| Member type
| Definition
|
|
|
| mutex_type
| Mutex
|
[edit] Member functions
|
|
|
| constructs new lock_guard object and locks the given mutex (public member function)
|
|
|
|
| destructs the lock_guard object, unlocks the underlying mutex (public member function)
|
[edit] Example